﻿package src.components 
{	
	/**
	* 
	* Reliability project
	* -----------------------
	* @author  Dmitrij Boycov
	* @mail    dmitry.boycov@gmail.com
	* @date    April 27, 2010
	* @version 1
	* 
	*/
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	import src.components.AbstractButton;
	
	public class HeaderBarButton  extends AbstractButton {
		
		private var base = null;
		
		/**
		 * construct
		 * @param	ico
		 */
		public function HeaderBarButton(ico,text){
			super();
			this.setTooltip(text);
			this.base = new BButtonBase();
			if (ico != null) {
				ico.x = 0;
				ico.y = 0;
				this.base.addChild(ico);
			}
			this.toolTip.align = "left";
			this.base.mouseChildren = false;			
			this.addChild(this.base);
			this.base.gotoAndStop(1)
			this.base.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
			this.base.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);			
			this.base.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
			this.base.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
		}	
		
		
	}
	
}